//
//  PlayCell.m
//  Travel_M_Travel
//
//  Created by dlios on 15-3-31.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "PlayCell.h"

@implementation PlayCell

- (void)dealloc
{
    [_albumTitle release];
    [_categoryName release];
    [_tags release];
    [_richIntro release];
    [_lyric release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.albumTitle = [[UILabel alloc] init];
        [self.contentView addSubview:_albumTitle];
        [_albumTitle release];
        
        self.categoryName = [[UILabel alloc] init];
        [self.contentView addSubview:_categoryName];
        [_categoryName release];
        
        self.tags = [[UILabel alloc] init];
        [self.contentView addSubview:_tags];
        [_tags release];
        
        self.richIntro = [[UILabel alloc] init];
        [self.contentView addSubview:_richIntro];
        [_richIntro release];
        
        self.lyric = [[UILabel alloc] init];
        [self.contentView addSubview:_lyric];
        [_lyric release];
    }
    return self;
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.albumTitle.frame = CGRectMake(5, 5, self.contentView.frame.size.width-10, self.contentView.frame.size.height/10);
    self.albumTitle.text = [NSString stringWithFormat:@"专辑: %@", self.play.albumTitle];
    self.albumTitle.font = [UIFont systemFontOfSize:12];
    
    self.categoryName.frame = CGRectMake(5, self.contentView.frame.size.height/10+10, self.contentView.frame.size.width-10, self.contentView.frame.size.height/10);
    self.categoryName.text = [NSString stringWithFormat:@"类型: %@", self.play.categoryName];
    self.categoryName.font = [UIFont systemFontOfSize:12];
    
    self.tags.frame = CGRectMake(5, self.contentView.frame.size.height*1/5+15, self.contentView.frame.size.width-10, self.contentView.frame.size.height/10);
    self.tags.text = [NSString stringWithFormat:@"标签: %@", self.play.tags];
    [self.tags sizeToFit];
    self.tags.numberOfLines = 0;
    self.tags.font = [UIFont systemFontOfSize:12];
    
    self.richIntro.frame = CGRectMake(5, self.contentView.frame.size.height*3/10+20, self.contentView.frame.size.width-10, self.contentView.frame.size.height/10);
    self.richIntro.text = [NSString stringWithFormat:@"简介: %@", self.play.richIntro];
    self.richIntro.lineBreakMode = NSLineBreakByTruncatingHead;
    [self.richIntro sizeToFit];
     self.richIntro.numberOfLines = 0;
    self.richIntro.font = [UIFont systemFontOfSize:12];
    
    self.lyric.frame = CGRectMake(5, self.richIntro.frame.size.height+self.contentView.frame.size.height*2/5+25, self.contentView.frame.size.width-10, self.contentView.frame.size.height/10);
    self.lyric.text = [NSString stringWithFormat:@"歌词: %@", self.play.lyric];
    [self.lyric sizeToFit];
     self.lyric.numberOfLines = 0;
    self.lyric.lineBreakMode = NSLineBreakByTruncatingHead;
    self.lyric.font = [UIFont systemFontOfSize:12];
    
    
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
